package com.wjh.graduation.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author Wu Jiahong
 * @since 2022-02-03
 */
@Getter
@Setter
@Accessors(chain = true)
@ApiModel(value = "Bill对象", description = "")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Bill {

	@TableId(value = "bill_id", type = IdType.AUTO)
	@ApiModelProperty("账单id")
	private Integer billId;

	@ApiModelProperty("用户id")
	@NotNull
	private Integer userId;

	@NotNull
	@ApiModelProperty("账单时间")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date time;

	@NotBlank
	@ApiModelProperty("账单分类，如吃饭、工资")
	private String category;

	@ApiModelProperty("账单备注")
	private String description;

	@NotNull
	@ApiModelProperty("账单金额")
	private Double money;

	@ApiModelProperty("收入/支出")
	private Integer type;


	public static final String BILL_ID = "bill_id";

	public static final String TIME = "time";

	public static final String CATEGORY = "category";

	public static final String DESCRIPTION = "description";

	public static final String MONEY = "money";

	public static final String TYPE = "type";

}
